// pages/home/home.js
Page({
  data: {
      // 定义页面映射对象
    pageMap: {
        grid1: '/pages/zhuanshengben/zsb_examInfo/zsb_examInfo',
        grid2: '/pages/chengkao/ck_examInfo/ck_examInfo',
        grid3: '/pages/zhongkao/zk_examInfo/zk_examInfo',
        grid4: '/pages/gaokao/gk_examInfo/gk_examInfo', 
        grid5: '/pages/zikao/zk_examInfo/zk_examInfo',
        grid6: '/pages/myExam/myExam', 
        // grid7: '/pages/zikao/zikao_page3/zikao_page3', 
        // grid8: '/pages/zhuanshengben/edit-post/edit-post',
        // grid9: '/pages/ck_exam_registrationInfo/ck_exam_registrationInfo' 
    },

    imageList: [// 首页展示的图片
        { src: '/icon/huiyi2.jpg' },
        { src: '/icon/test2.jpg' },
        { src: '/icon/test3.jpg' },
    ],
},
//页面跳转
// 统一跳转函数，根据 data-type 获取跳转路径
gotoPage(e) {
    const type = e.currentTarget.dataset.type;
    const url = this.data.pageMap[type];
    if (url) {
      wx.navigateTo({
        url: url,
        success: res => console.log('跳转成功:', url),
        fail: err => console.error('跳转失败:', err)
      });
    } else {
      console.error('未找到对应的页面路径，type:', type);
    }
},
handleImageTap: function(e) {
        // wx.navigateTo({
        //     url: '/pages/activity2/activity2', // 替换为你要跳转的新页面路径
        // });
        wx.navigateTo({
          url: 'https://www.nm.zsks.cn/zxyw/202411/t20241105_45361.html',
        });
},
})